<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <style>
        div {
            position: absolute;
            left: 0;
            width: 100px;
            height: 100px;
            background-color: pink;
        }
    </style>
</head>

<body>
    <div></div>

</body>

<script>
    let div = document.querySelector('div');
    let x;
    let y;
    div.addEventListener('touchstart', function(e) {
        x = e.touches[0].pageX - this.offsetLeft;
        y = e.touches[0].pageY - this.offsetTop;
        console.log(x + ',' + y);
    });
    div.addEventListener('touchmove', function(e) {
        e.preventDefault();
        this.style.left = e.touches[0].pageX - x + 'px';
        this.style.top = e.touches[0].pageY - y + 'px';
    });
</script>

</html>